package com.hh.example.SpringListener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationEvent;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 16-3-23.
 */
public class PeopleEvent extends ApplicationEvent {

    private  String name;
    private  int age;
    //该构造函数必须有
    public PeopleEvent(Object source) {
        super(source);
    }

    //必须要有Object这个参数
    public PeopleEvent(Object source, String name, int age){
        super(source);
        this.name = name;
        this.age = age;
    }


    @Override
    public String toString() {
        return "MyListenEvent{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
